Refactored a bit and improved the FS scanner