Refactoring controller destructor