Improvements on garbage collection