refactoring and fix raw-html