fixing broken newlines, removing obsolete function, cleanup