added reloadConfig function.  more scope cleanup.