Moved file collection code to utils