Some refactoring in transform.lisp