small refactoring of format