More UI work done, refactoring