Moved main loading into new function