NAT code clean up