logic cleanup in perf loop