Budget calculation and test refactoring