new design to platform class and apply destructor