More InputTermBuilder refactoring