Refactored error messages and removed prettify.