code cleanup, revised class diagram, updated design doc (work in progress)