refactoring for UI development