Slightly cleaner exception handling