WIP simplify err check funcs