Simplify some icon choosing code