Refactor location override condition with hasattr/getattr stanza