Added the avatar defaults callback
Replaced deprecated functions