Added push service connection callback and minor refactoring