state and strategy pattern