idisposable refactoring