Code is a bit DRYer