Refactored exceptions a bit