Turn a method into a function