refactored data directories, refactored functions