method toString on MethodClass refactored