Added setup function and usage of global config object