code cleanup around PCA