Overhauled the master template