Support passing directory as parameter
Cleanup get_extractor a bit