Less handling in index.php, more in class.