Minor refactoring in file parsing.