the application still crash but we've factorized the code used in the main function