Refactoring ui outside of model