Cleaned up refactored ui code.