PortalKit: a little refactor