Reworked UI code to be more like book