Switch to classes.
Reformat index.php