remove duplicate code in pattern coerce/trigger