refactor the strategy pattern following item 35 Meyers' book