Code refactoring in Home page