Refactor and add a method to look for text in the table