Refactored the front end a little bit