push pca extraction logic into the state so that I can put it in a synchronized block