Fix views according DRY, move html code to templates.