refactoring front-end