Refactored pre processing pipeline.