valid refactoring