moved some parallel code to avoid costly duplication