refactored a ton of the front end code to make the pages look nicer