Did some refactoring to prepare for .NET client unsubscribe fix