refactor consistency check