[infobar] optimize code and fix scrolling in second infobar