front end refactor