Refactor preprocessing step to class
Preprocessor edge cases and unit test