Refactoring error check...