condition refactoring