more cleanup and preparation for port blocking