Refactor to make coding other admin pages easier.