And yet more code refactoring.