some changes in home controller for good code structure