tidied up if conditions in config