Add support for methods as handler functions