refactoring of ui