front-end almost refactored