DRYer code and better variable names