Refactoring: using const for terms