Environmental assessment of bioenergy production through suitable wastewater and waste management