remove empty newline and remove useless code