debut refactoring app.class.php