polished and slight reorg