Optimize the changing of icons