Refactor beforeSave and afterSave hooks.