Refactor front end state machine

Renamed controllers and templates to make sense