refactor, dirnames and workspace