refactor core and app construtors