filehandling improvements