reusing functions in dplyr