Trying to fix duplicate IF.