refactor widget delete