refactoring formatter to use template pattern, plugin uses formatter via DI