code reorganization/cleanup