First set of page load optimizations
More minor optimizations (hoisting, reducing if-checks, etc)