using an intermediate representation