slightly restructure view.php