implemented strategy pattern