refactoring in datomic-util