A little code reorganization