Refactor code in effects to use data_priv. Re- Close gh-1244.