DRYied thanks to Roman's idea