remove whitespaces and extra lines