Move logic for embedding to wrapper