A sustainable approach for water management and nutrient recovery