Refactoring. Getting plumbing to work