afellay had been instrumental in connecting the cells involved with returning mujahideen who had received military training in afghanistan before returning to morocco and most importantly the connection of religion , not political philosophy , as the basis for the various groups .