Refactors word search into a class