Implemented the strategy pattern