cpp formatters: refactor class info formatting

seems like we had a lot of duplicate code for no reason, improve it.
patches: add refactor formatters