refacotr directory structure