reorganized to be closer to what is needed for the new approach
more reorganizing