refactoring username selecting