classes.php optimization