tcp: rename internal helper functions