refactor easier to read
filter predicate for plugin name
sort list of items putting most recent "id" at top
fix write function to remove file on error
reorganise order of code
nev version