Refactoring: move up error class.