clean up the analysis pipeline, will probably need larger refactor