cantor refactored