how to wrap a class and an object