It might be good to break this into a separate PR.