#8 optimize memory usage of Word Counter