Apply State pattern