refine the method to get the config context

refine the method to get the config context