refactoring method on app