Updated for Config changes
Made functions global