Refactoring preprocessing chain