Reusable class to scan files