write strategy pattern