Add State pattern.