type first, then state