Replace hardcoded state numbers with constants