Refactor cps tests