Make close event a more generic class