Refactored GarbageColletor.c