refactored ui file