Application refactoring