Refactored some parts of the UI