Refactoring reference interpreter code (part 2)