Make _makeObject more general to allow for more class types