refactoring sanitizer and "unit" test