made things a bit more DRY