Refactoring

already defined auto detection