Reordered the code slightly, and increased our unit tests for this class