Refactor of the UI code to group things better and switch more things to the _ naming scheme