improved tests with metaprogramming