simplify logic to find buttons.