ME-154 refactor avatar code and test patch profile