split balde_app_run code in 2 functions