Could this be moved into the following `if(attrs.pageId) {` conditional?