clean up threshold tuning