test for add obligation, refactor