Improved the error handling in the face of adversity and removed the implicit closing - not our responsibility - it is the callers.