cleanup and some boiler plate for local tests