add strategy pattern code