Simplify avatar code