small refactoring of ad index display