Moved code into Refresh.php