Refactored to have the same button search and handle it.