Re-factor test cases