refactoring app and extension structure