A few modifications/refactoring to the couchbase check