Would be better to use `array_key_exists` instead of `isset` since it's possible to set layout to `null`. Same below for template.