CLN: clean up data.py

closes #4001 
closes #3982
closes #4028