Reorganization of the database, modifying functions.php