use new and delete for type safety