The main purpose of this change is to allow modifying the configuration for testing. This change does lead to some ugly code where `get_config` function gets called in random places.