add(packer): generalize generation of different kinds of nodes