refactor directories and params