extractor.cpp refactored a bit

I've split extractor.cpp code to methods and organized them in class.