Refactor cypher