some code cleanup and sanitizer simplification