A little cleanup and reorganization