remove trailing space, delete obsolete snippets