reorganized state flow