making controllers more DRY