Custom instantiation and destruction