factor out package node creation