some file abstraction refactorings