Added documentation for methods and cleaned up/consolidated some of the
code.