nit: instead of mutating ast can you create a new var?