Make save and recall procedure more generic