Working on refactoring auto-detection handling.

6 files changed