adapted to new link system, cleanup