Major refactor of the UI