further refactoring of frontend