optimize data structure and directory structure