A optimizer for ESL