Remove whitespaces and remove unncessary codes