Refactor of some template/view/html related stuff.