Implemented the strategy design pattern