refactor dependencies, dirs and links