ast optimization idea