Refactored tests

Cleanup to avoid duplication