Improve a lot and add smart util to recognize term