code redesigned

Optimization:
-obsolete code removed
-getNewestFilesMethod() redesigned