icom: fixing a if clause spaghetti