refactoring html and string helpers