refactor front-end