Moved user avatar generation to macro