Refactor the index.php page