Start to refactor latency analysis plugin