Some code reorganization.