rewrite mnemedb factory