Implement garbage collection