remove some repeated code + fine tune save and deletion periods