Added code for strategy pattern