refactored utils with all socket and port info