Refactored exportResults() method