Refactoring template.php view.