Refactored build cube into small prefix and buildLayer1(SequenceRecorder)