refactored app bootstrapping