Move config functions to window.load