factory init app example