minor refactoring of feature detection
v2.0