priv analysis code cleanup