Frontend refactor