Refactor HTML code into ERB templates