Small refactor of directory creation script