added homePage and did some refactoring