move node class hierarchy into writer