fix memory leak for tests that don't rely on setup function
rework brace usage