Moving scripts to improve loading