Change how method invocation works to fix memory issues.