Further code reorganization