updated how files are loaded to enable easier porting