Removes unneeded and slow graph code