Move non class definition code to index.php