Move local types.
Remove redundant imports.
Give to TCP what belongs to TCP.
Remove dead code.