refactor: move Term into its own module.