Remove duplicate code from test bootstrap