Refactored code for transitions between pages and made a few minor tweeks to UI