refactored
used a helper to escape HTML

Signed-off-by: Steven Magelowitz <steven.magelowitz@gmail.com>