Extract CouchDB logic from Resource to dedicated helper class