Refactor out SD_FLAG_IS_CATEGORY