Cleanup, use get('foo', 0) + 1 instead of if/else.