refactored favicon code