Simplify the sanitize function