refactor directories and param