[wip]
[wip] more refactoring for all trial analysis