Move the var init

The pageReady event can all be called from one script