Refactored string creation for file search