adding a wrap-defn-in-fn refactoring