With so many browsers to think about, one need to adjust a site so it looks almost same (identical would be miracle) in all of the major modern browsers. And favicons are not an exception.
I have been thinking about learning RegEx. It seems like you can cut down coding with the use of RedEx, i.e. extracting data from a string, replace data from string.