use encodeURI, move regex matching to Model.Regex, small styling changes