more code reorganization changes