polished code to config related routines.