could you please extract this branch into method?