add test for General Controller
clean code 
fix few bugs