Code refactored in Home page