rearraning couchdb structure