refactored get string