add cpp version strategy pattern