Refactoring reference interpreter code.