DRYed up code by using partials