Refactored exceptions into its own module.