added reusable logic to the save_prep method.