Swithed from gen-class to defprotocol and deftype.