Refactored some code, removed html_safe call, added TODO