[CORE] remove duplicated code in the config module