factoring out cypher