reorganize app to seperate control program from methods