Extract dictionary into new class