State pattern is implemented