Added sanitize_to_id helper method