Clean up conversion helper function