remove comments and trailling whitespaces