more refactoring of avatar_url