separated out data pipeline from analysis code in a very crude way
bug
cosmetic adjustments to refactor