dir struct optimize