Final parser

refactoring and extracting of classes