parts of testing utils ported