refactor dispose event