Microsites alongside Theme

The logic is to first check that the request is not a microsite-request before choosing the branding templates from the theme.
Why casting here ?