refactored checked exception throwing