moved assertions into helper