refactor casper example test