refactor of deletion models code