Optimising the re-use and recycling of waste water