How to avoid this type of duplication

when I made a rubiks cube, i made each piece a separate mesh, then using rotationGroup.attach (cubelet) them to a single rotation group object when rotating… then scene.attach(cubelet) them back to the scene when the rotation is done.

https://manthrax.github.io/qube/