Cube and piece refactoring.