Add cleanup method in output class