Another refactoring pass!