Helper and tests