Refactored Sql Extractor Tool