More robust username fetching, refactoring, and comments