front end refactoring