refactor frontend