Refactoring JS messages in HTMLFragment subclasses