Tidy up exception throwing