finished refactor of front end