Further adapted to new class structure.