Refactory the directory