Refactor blockTransformer to use general phases