Refactors the main results template.