Use a case statement in db.load