Removing unencessary if block