Added State pattern