some cleanup to CouchDB plugin