Refactor document retrival from Couchbase