Refactor the if into a ternary conditional expression
Use a more fool proof way of setting default value
Add test for usage of the acc argument