Optimize code structure and update icon