Request: rewrite set_params for better testability