Move loading a module by filename into a helper function