moved compiler state to a separate struct