Minor code reorganization.