Refactored GarbageCollector.c and increased reusability