Another refactoring - this one works.