functions for managing polymorphic objects