Make both parse functions the same
Extract function to break file into groups
Simplify category parsing
Use break-by when parsing patterns