Minor refactoring - Extracted the code to retrieve a Method pointer for an instance method or a class method and throw an exception if none of both is found