Refactor file parsing patterns.