Made some of the pieces functions private.