Refactored cube creation