Some refactoring in BaseFile