cleaned up file loading