Refactor: $timeout and problems with word count