refactoring, empty string condition