Refactor html helper