refeactor to require a non-empty string