rebuild tests logic