Improve detect