Adapted to new class structure