fully refactored tcp_listener
final touches