refactor out replacement into strategies to allow different replacement actions