fight logic and code reorg