Removing unneeded if block