continued refactoring of set_params