Update includes a few helper methods and some code rearrangements.