Refactor to use count method in word_count method
Rubify code