extract metric cleaner logic and use it for telemetry reporter, too