Added extractor factory

- Improved exceptions
- Added tests