Add text-only option; Clean up auto-detect code