Restored app_factory entry point