extracted precondition check into separate method