The best way to prevent rusting is to clean the tank with CLR regularly. This will remove corrosion before it starts affecting components. You can also examine your pipes and replace any that has rusting inside.