a little bit DRYer now