Restructured. Next step is generalisation to callback based parser.