Refactored complex data format selection.