RavenDB-2174: some more code refactoring