[IM] More flexible and correct config context