Code cleanup, preparing for 3d workshop