factorize the initialization code for the app and put it in inc/init.php