refactor experiment code.