clojure: refactored the morphism function