Added a shared getConfig function.