Rearranged and renamed some methods to make the test cases work.