PortalKit: modify the structure of js