Start of rewriting packElement to be easier to modify