Cleanup a bit and add monoid.