Refactor tcInferArgs and add comments.