Refactor base pipe to attach to lmdb