moved code from neo4j gem to core