Minor if to else if improvement