Make layout classes disposable