refacto tinymce directive with words count