Refactor dayCount logic, moved into tree model.