refactor experiment callbacks and add tests