refactoring: make error message more readable, simplify sequence in #check