code repetition slightly reduced