refactoring of the experiment class