Structure directory refactor