Preprocess gap extraction is modified to use an appropriate gap extract function
Merge branch 'refactoring'