Refine testing functions