escaping of text in hints
minor refactoring