refactored p2p connections completely