styled the index page and refracted the code