removing old terminals with duplication
adding new terminals without duplication