df2: reorg code