Cleaned up _iptables function