Refactored data processing