front-end refactor