[refactor] improve support for local testing.