frontend refactoring