Move UnregisterClass() to dtor
Code refactoring