Improve style of experiment code