refactoring suggestion