refectored the code of HomeController
resolved merge conflicts