refactor avatarmanager