Refactor tamarin testing