reimplemented SubstitutionTransformer based on CopyOnWriteTransformer