Cleaned up garbage collector code a bit