Refactorization for making app more independent (act more like reusable app)