DRYing and simplifying