pushed mergeNode logic into DatabaseActions