PortalKit: refactor templates into views