Refactoring of the network connection. Implemented some observer to
clean up the dependencies.