refactor the strategy pattern
update