Refactored util into util and ui.