dp foldr is used for design pattern, add strategy pattern