Migrated to State pattern