Add update option.
Refactor tests.