Detect modular when stratum found
Improve the automatic detect code