unifying more code in frontend tests