Simplify disposal of some resources