code clean up dao and controller