more DRY version