Refactoring: refactor frontend.