refactoring unless