file loading stuff and some exception improvements