Extracted errors to separate class and extended a bit