Refactoring frontend