Cleanup, including improved error handling with Try.