Better username extractor logic