reduce code ammount with one-line refactoring