pre-save refactor
generalize the save method