refractoring CubeSaver