Tidyup footer to reduce duplicate config_get calls

f5447bf9cec408ee250aa2a4f09872aa748788ff
It seems that the goal of this commit is to avoid duplicate config_get() -- Where the if statements does the 3 config_gets(), then inside the if we re-fetch the same configs.