Refactor latency module #6
Update test cases #6