refactor control logic up into PcieTop