small rearrangment of save code before refactor