reorg code structure