I believe `get_case_by_identifier` hits the database three times if the case is not found. Wouldn't it be better to short-circuit here and skip all those DB hits? You can ignore this suggestion if performance doesn't matter.