Made custom icon rules more general