Moved logic into a partial from the diagnostic index view