cube sanitization [this may need to be dropped from this branch and
cherry-picked somewhere else]