Improved exception messages
Removed useless code blocks
Added regions and comments