Refactoring case # regexp into case model.