move term setting to lib

Change-Id: I31f605ac242d02fb692b89e0c29d6d0a1358fcf4