rework the library, use class variables for contracts instead of code generation.