Implement proper disposal of resources