Avoid creating word_freqs outside and passing it around.