object oriented strategy pattern refactor