The new legislation has been driven in part by tireless campaigning.