simplify running processing and checking errors, improve regexes