Simplifies the implementation of IDisposable