updated replace system to have passable key=>values