Make testing code more compact

Increase readability