Made this a little DRYer by using a constructor