Refactored the parser to have a more expressive data type
Improved the data structures