Strategy pattern

implement strategy pattern