Reduce duplicated params["attributes"] code