refactored DatabaseExtractor.java.