refactoring API to support round-tripping to RavenDB