a bit code reuse, and auto detect term type