Generic data transformation