Consolidate some file operations