Minor refactoring in cube.h