Simplify PrimitiveCellTransformation code into a recursive algo.