More refactoring, hooking bakc up latency sampling.