more flexible save method