this ``if`` block is almost the copy of the upper one, can we extract it to private method?