Refactoring mkdir for /data and /index