extract getMethod out of invokeMethod so we can make more flexible in
future