refactor for an example monoid use