clojure: refactored the symmetries function