Implemented extraction logic.