This method could be removed if modal context logic is moved into this class (see other comment).