Refactored to shorten, remove rescues, and clarify.