fixes email validation & moves several lines into partials