Refactor view partials and add error messages.