Factorize setup, teardown and test creation