convert serialiser to OO style
rename parse tree node factories