allow going back to the homepage without reloading
make code more modular