a bit of tcplay support code refactoring