Refactoring and enhancements for Cypher transactions