Code refactoring, add Ui concept