frontend refactor