Refactored based on code review feedback and finished docblocks.