refactored word-lookup controller