refactor whole app. Change thniking and usage