Merged createPacket functions into one template variable