That would already be a good improvement, both in terms of DRY and readability, without the need of adding another dependency.