refactor base app