Simplify settings port cleanup logic