All sorts of pointer-related refactoring