UI improvements, Code refactoring