extract common setup and count previous resource version saves