remove unneeded if block