adds "ng-socket" and refactor socket communication