move collect-internal-methods into an emitter pass