Refactor eyaml class to use datadirs function