some refactoring and dont rescan alredy inserted files