a bit of restructuring and got
the parser to work better