PortalKit: remove the redundant part of codes