Make term object instead of globals