Refactored htmltoword.

Refactored htmltoword.