refactored frontend