refining testing logic