refactor implement of support for subApp