Finished front end, refactoring