Cleaning up the reference loading process