pattern portal implementation