DRYied according to comments