Memoize word_count and remove method arguments