librarycleaner allmost completely rewritten