further refacting and modularizing of the app