Move test helpers into common