PortalKit: refactor the structure of portalKit