made reconnect service externally configurable, more streaming code refactoring, unit tests