avoid a bit of code repetition