Separate loading functions from main js file