more progress, code reorg, clean