a helper to compute all the embeddings efficiently and that's backward compatible