#TODO Optimizations and improvements, see comments. Maybe automatic deletion, hardlinking or other actions on dupes?