Done some refactoring on the cube orientation