generating type classes