Refactored: extracted method sanitizeSchema() to make sure the internal API has not been changed