Extracted escapeForMethodName()