Refactored Config::set() method.