refactored string input