move the config code to util