Changed building data_dirs to a private function with list comprehension.

CI-171