improved file loading