smarter self detection