cleaner way to sanitize paths