Extracted logic into methods
Extracted process_loaded_file and mtime methods for clarity
Extracted clear methods and finishing touches
typo fix