refine handling of files