Moving delete function to models