some code refactoring, first frontend code