Moved extraction and extraction handling in separate functions
Merge pull request #6 from ruhleder/bugfix-func-inside-loop

Moved extraction and extraction handling in separate functions