better username extraction