AI beautifying function