Improve html generation for base views