create class based on object