dir refactory