Factor out save action to its own method.
W3C fixes.