Refactoring part 2 of 2.